import request from '@/config/axios'

// 物资分类 VO
export interface AssetsCategoryVO {
  id: number // 编号
  parentId: number // 父级ID
  assetType: number // 物资类型
  name: string // 分类名称
  sort: number // 排序
  status: number // 状态
  remark: string // 备注
}

// 物资分类 API
export const AssetsCategoryApi = {

  // 查询精简物资分类列表
  getSimpleAssetsCategoryList: async (params: any) => {
    return await request.get({ url: `/school/assets-category/simple-list`,params })
  },

  // 查询物资分类
  getAssetsCategoryList: async (params: any) => {
    return await request.get({ url: `/school/assets-category/list`, params })
  },

  // 查询物资分类详情
  getAssetsCategory: async (id: number) => {
    return await request.get({ url: `/school/assets-category/get?id=` + id })
  },

  // 新增物资分类
  createAssetsCategory: async (data: AssetsCategoryVO) => {
    return await request.post({ url: `/school/assets-category/create`, data })
  },

  // 修改物资分类
  updateAssetsCategory: async (data: AssetsCategoryVO) => {
    return await request.put({ url: `/school/assets-category/update`, data })
  },

  // 删除物资分类
  deleteAssetsCategory: async (id: number) => {
    return await request.delete({ url: `/school/assets-category/delete?id=` + id })
  },

  // 导出物资分类 Excel
  exportAssetsCategory: async (params) => {
    return await request.download({ url: `/school/assets-category/export-excel`, params })
  },
}
